﻿@model Orion.Models.HomeIndexViewModel
@{
    ViewBag.Title = "IRIS - Innranet - Hjálp";
    Layout = "~/Views/Shared/_WorkLayout.cshtml";
}


<section id="main_content">
<h1>Um IRIS</h1>


<table>
<caption></caption>
<thead>
    <tr>
        <th>Dagsetning</th>
        <th>Titill</th>
        <th>Höf.</th>
        <th></th>
        <th></th>
    </tr>
</thead>
<tbody>
    @foreach ( var ab in Model.NewsArticle )
    {
    <tr>
        <td>@ab.ContentDate</td>
        <td>@Html.ActionLink(ab.Title, "GetContentById/" + @ab.ID, "WorkPageContent")</td>
        <td>@ab.Author </td>  
        <td>@Html.ActionLink( "Breyta", "EditAbout/"+@ab.ID, "WorkPageContent" )</td>
        @if( ab.Valid == true )
        {
            <td>@Html.ActionLink( "Eyða", "DisablePageContent/"+ab.ID, "WorkPageContent", new { onclick = "return confirm( 'Ertu viss um að þú viljir eyða textanum?' )" } )</td>
    
        }
        else if( ab.Valid == false )
        {
            <td>@Html.ActionLink( "Birta", "EnablePageContent/" + ab.ID, "WorkPageContent", new { onclick = "return confirm( 'Ertu viss um að þú viljir birta textann?' )" } ) </td>    
        }
    </tr> 
    }

</tbody>

</table>
</section>